from rest_framework import permissions

from user.models import ProjUser


class IsAdminPermission(permissions.BasePermission):

    def has_permission(self, request, view):
        user = ProjUser.objects.get(username=request.user.username)
        return user.is_admin
